package Day004.ZuoYe01;

import java.util.Calendar;
import java.util.GregorianCalendar;

public class Test04 {
    public static void main(String[] args) {

        GregorianCalendar gc = new GregorianCalendar();

        int year = gc.get(Calendar.YEAR);
        System.out.println(year); //2020
        int month = gc.get(Calendar.MONTH);
        System.out.println(month); //3-->4月
        int day = gc.get(Calendar.DAY_OF_MONTH);
        System.out.println(day); // 19
        int hour = gc.get(Calendar.HOUR_OF_DAY);
        System.out.println(hour); //18
        int min = gc.get(Calendar.MINUTE);
        System.out.println(min); //51
        int s = gc.get(Calendar.SECOND);
        System.out.println(s); //44

    }
}
